<template>
  <div id="line">
    <div class="content">
      <el-card>
        <div class="title"><h2>住宿酒店</h2></div>
        <div class="list">
          <Item
            :item="item"
            v-for="item in data"
            :key="item"
            @click="togo('./hotel?id=' + item.id)"
          />
        </div>
      </el-card>
    </div>
  </div>
</template>

<script setup>
import Item from "@/components/Item.vue";
import { ref, reactive } from "vue";
import { useRouter } from "vue-router";

const data = reactive([
  {
    id: 5,
    img: require("@/assets/img/hotel/ht01.jpg"),
    title: "上海虹桥九亭天地美居酒店",
    price: 317,
  },
  {
    id: 6,
    img: require("@/assets/img/hotel/ht02.jpg"),
    title: "上海外滩豫园美居酒店",
    price: 1038,
  },
  {
    id: 7,
    img: require("@/assets/img/hotel/ht03.jpg"),
    title: "北京朝阳门工体美居酒店",
    price: 881,
  },
  {
    id: 8,
    img: require("@/assets/img/hotel/ht04.jpg"),
    title: "北京后海南锣鼓巷CitiGO欢阁酒店",
    price: 705,
  },
]);

const router = useRouter();
const togo = (path) => {
  router.push(path);
};
</script>

<style lang="scss" scoped>
#line {
  margin-top: 30px;
  ::v-deep .el-card {
    width: 100%;
  }
  .title {
    height: 60px;
    line-height: 60px;
    border-bottom: 1px solid #e3e3e3;
    margin-bottom: 20px;
  }
  .list {
    display: flex;
    justify-content: space-between;
  }
}
</style>
